CREATE PROCEDURE coreSchedulerGetAll
(
	@OrderBy int,
	@SortDirection int
)
AS
BEGIN
IF @SortDirection > 0
BEGIN
	IF @OrderBy = 0
		SELECT * FROM ScheduledTasks ORDER BY ExecuteNext ASC;

	IF @OrderBy = 1
		SELECT * FROM ScheduledTasks ORDER BY TaskName ASC;
END
ELSE
BEGIN
	IF @OrderBy = 0
		SELECT * FROM ScheduledTasks ORDER BY ExecuteNext DESC;

	IF @OrderBy = 1
		SELECT * FROM ScheduledTasks ORDER BY TaskName DESC;
END
END